Integrate SonarQube Cloud workflow Analysis#689
Conversation
mpusz
left a comment
There was a problem hiding this comment.
It took much longer than I thought. Thank you again for your help! 👍
|
Hi @alejandro-alvarez-sonarsource! Can you check out: https://github.com/mpusz/mp-units/actions/runs/23859267371/job/69561133842? Can we fix that somehow? I would like for this workflow to reurn meaningful results and not just fail all the time :-( |
Hi, I’ve only managed to reproduce this locally and not deterministically. So far it has only happened when I jump between commits while keeping the existing build directory. My current suspicion is On GitHub runners I haven’t seen it happening at all, and my ccache there is empty, which seems to point in the same direction. I’d suggest we disable ccache for this coverage job and see if the issue disappears. |
|
Sure, let's try it |
|
@alejandro-alvarez-sonarsource I think it helped 🤓 Thanks! |
Hello,
As we discussed, here is the workflow file adding the CI for analyzing the code in SonarQube Cloud.
Here is an example of a successful run. We can see this in the logs:
Which means there was nothing that we had trouble parsing, and hence the results are complete.
And here you can see the results of the analysis.
I am not sure about the reliability of coverage, though. I can see some
constevalbeing flagged as not being executed during runtime, which of course they aren't. Since coverage is handled byclangfor instrumentation andllvm-covfor extracting the information, I imagine it's more on their side.If you are happy with this, you will need two new secrets:
SONAR_TOKENandSONAR_HOST_URL(the latter just beinghttps://sonarcloud.io, not really a secret). For the token you will need to onboard the project, then go to Administration / Analysis Method, disable automatic analysis and follow the instructions for GitHub Actions.If you need help setting anything up, I'll happy to help.
P.S I think it may be better to merge into a temporary branch that lives under your repo to make sure it works, since I believe actions with secrets do not run when the PR comes from the outside.
P.P.S Full disclosure, I have seen a handful of kind-of-false positives for "Identical sub-expressions on both sides of operator" (they are identical, but they are within
requires, and it should not apply there IMHO). I have filed a ticket for these.Rules you disagree with can be disabled, though.